package com.example.gamecenter.activitys

import android.annotation.SuppressLint
import android.app.Application
import android.net.http.SslError
import android.os.Bundle
import android.view.KeyEvent
import android.view.View
import android.webkit.RenderProcessGoneDetail
import android.webkit.SslErrorHandler
import android.webkit.WebChromeClient
import android.webkit.WebView
import android.webkit.WebViewClient
import android.widget.LinearLayout
import androidx.appcompat.app.AppCompatActivity
import com.example.gamecenter.MainActivity
import com.example.gamecenter.MyApplication
import com.example.gamecenter.R

class WebviewActivity: AppCompatActivity() {
    private lateinit var webview: WebView;

    @SuppressLint("SetJavaScriptEnabled")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_webview);
        webview = findViewById(R.id.gc_webview);
        webview.settings.javaScriptEnabled = true
        webview.settings.domStorageEnabled = true
       // webview.loadUrl("https://h5itokenla.147358.top/index")
        webview.loadUrl("https://test-pay-h5.axzo.cn/#/pages/payroll/salaryApply/salaryManagement")
    }
    override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
        if (keyCode == KeyEvent.KEYCODE_BACK && webview.canGoBack()) {
            webview.goBack()
            return true
        }
        return super.onKeyDown(keyCode, event)
    }

}